<?php /*a:3:{s:62:"D:\xampp\htdocs\xtbb\tp\application\admin\view\user\index.html";i:1545006922;s:65:"D:\xampp\htdocs\xtbb\tp\application\admin\view\Public\header.html";i:1545014644;s:63:"D:\xampp\htdocs\xtbb\tp\application\admin\view\Public\menu.html";i:1545014335;}*/ ?>
<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Amaze UI Admin index Examples</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/png" href="/xtbb/tp/public/admin/assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="/xtbb/tp/public/admin/assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <link rel="stylesheet" href="/xtbb/tp/public/admin/assets/css/amazeui.min.css" />
    <link rel="stylesheet" href="/xtbb/tp/public/admin/assets/css/admin.css">
    <link rel="stylesheet" href="/xtbb/tp/public/admin/assets/css/app.css">
    <style type="text/css">
        .pagination{text-align:center;margin-top:20px;margin-bottom: 20px;}
        .pagination li{margin:0px 10px; border:1px solid #e6e6e6;padding: 3px 8px;display: inline-block;}
        .pagination .active{background-color: #dd1a20;color: #fff;}
        .pagination .disabled{color:#aaa;}
    </style>
</head>

<body data-type="generalComponents">

        <header class="am-topbar am-topbar-inverse admin-header">
    <div class="am-topbar-brand">
        <a href="<?php echo url('index/Home/home'); ?>" class="tpl-logo">
            <img src="/xtbb/tp/public/index/image/logo.png" alt="">
        </a>
    </div>
    <div class="am-icon-list tpl-header-nav-hover-ico am-fl am-margin-right">

    </div>

    <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only" data-am-collapse="{target: '#topbar-collapse'}"><span class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span></button>


    <div class="am-collapse am-topbar-collapse" id="topbar-collapse">

        <ul class="am-nav am-nav-pills am-topbar-nav am-topbar-right admin-header-list tpl-header-list">

            <li class="am-dropdown" data-am-dropdown data-am-dropdown-toggle>
                <a class="am-dropdown-toggle tpl-header-list-link" href="javascript:;">
                    <span class="tpl-header-list-user-nick">当前用户：<?php echo htmlentities(app('session')->get('platform.username')); ?></span><span class="tpl-header-list-user-ico"></span>
                </a>
                <ul class="am-dropdown-content">
                </ul>
            </li>
            <a class="am-dropdown-toggle tpl-header-list-link" href="<?php echo url('admin/Login/login_out'); ?>">退出</a>
        </ul>
    </div>
</header>
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>

        <div class="tpl-page-container tpl-page-header-fixed">
    <div class="tpl-left-nav tpl-left-nav-hover">
        <div class="tpl-left-nav-title">
            导航菜单
        </div>
        <div class="tpl-left-nav-list">
            <ul class="tpl-left-nav-menu">
                <li class="tpl-left-nav-item">
                    <a href="<?php echo url('admin/Index/index'); ?>" class="nav-link active">
                        <i class="am-icon-home"></i>
                        <span>首页</span>
                    </a>
                </li>
                <li class="tpl-left-nav-item">
                    <!-- 打开状态 a 标签添加 active 即可   -->
                    <a href="javascript:;" class="nav-link tpl-left-nav-link-list active">
                        <i class="am-icon-table"></i>
                        <span>项目管理</span>
                        <!-- 列表打开状态的i标签添加 tpl-left-nav-more-ico-rotate 图表即90°旋转  -->
                        <i class="am-icon-angle-right tpl-left-nav-more-ico am-fr am-margin-right tpl-left-nav-more-ico-rotate"></i>
                    </a>
                    <ul class="tpl-left-nav-sub-menu" style="display:block">
                        <li>
                            <!-- 打开状态 a 标签添加 active 即可   -->
                            <a href="<?php echo url('admin/Index/index'); ?>" >
                                <i class="am-icon-angle-right"></i>
                                <span>项目列表</span>
                                <i class="tpl-left-nav-content am-fr am-margin-right"></i>
                            </a>

                            <a href="<?php echo url('admin/Index/add'); ?>">
                                <i class="am-icon-angle-right"></i>
                                <span>项目文章</span>
                                <i class="tpl-left-nav-content-ico am-fr am-margin-right"></i>
                            </a>

                        </li>
                    </ul>
                </li>


                <li class="tpl-left-nav-item">
                    <!-- 打开状态 a 标签添加 active 即可   -->
                    <a href="javascript:;" class="nav-link tpl-left-nav-link-list active" onclick="method()">
                        <i class="am-icon-table"></i>
                        <span>用户管理</span>
                        <!-- 列表打开状态的i标签添加 tpl-left-nav-more-ico-rotate 图表即90°旋转  -->
                        <i class="am-icon-angle-right tpl-left-nav-more-ico am-fr am-margin-right tpl-left-nav-more-ico-rotate"></i>
                    </a>
                    <ul class="tpl-left-nav-sub-menu" style="display:block">
                        <li>
                            <!-- 打开状态 a 标签添加 active 即可   -->
                            <a href="<?php echo url('admin/User/index'); ?>"  >
                                <i class="am-icon-angle-right"></i>
                                <span>用户管理</span>
                                <i class=" tpl-left-nav-content-ico am-fr am-margin-right"></i>
                            </a>
                            <a href="<?php echo url('admin/Admin/index'); ?>"  >
                                <i class="am-icon-angle-right"></i>
                                <span>管理员管理</span>
                                <i class=" tpl-left-nav-content-ico am-fr am-margin-right"></i>
                            </a>
                    </ul>
                </li>

            </ul>
            <script type="text/javascript">
                $('.tpl-left-nav-sub-menu li a').on('click',function () {
                    $(this).removeClass('active').addClass('active')
                    $(this).siblings().removeClass('active')
                    $(this).parents('.tpl-left-nav-sub-menu').find('.tpl-left-nav-sub-menu li a').removeClass('active')
                })
            </script>
        </div>
    </div>


        <div class="tpl-content-wrapper">

            <ol class="am-breadcrumb">
                <li><a href="#" class="am-icon-home">首页</a></li>
                <li><a href="<?php echo url('admin/user/index'); ?>">用户管理</a></li>
                <li class="am-active">用户列表</li>
            </ol>
            <div class="tpl-portlet-components">

                <div class="tpl-block">
                    <div class="am-g">
                        <div class="am-u-sm-12 am-u-md-3">
                            <div class="am-btn-toolbar">
                                <div class="am-btn-group am-btn-group-xs">
                                    <button type="button" class="am-btn am-btn-default am-btn-success" onclick="add()"><span class="am-icon-plus"></span> 新增</button>

                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="am-g">
                        <div class="am-u-sm-12">
                            <form class="am-form">
                                <table class="am-table am-table-striped am-table-hover table-main " style="font-size:1.2rem">
                                    <thead>
                                        <tr>
                                            <th class="table-title">用户名</th>
                                            <th class="table-date am-hide-sm-only">更新时间</th>
                                            <th class="table-set">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <?php if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): if( count($list)==0 ) : echo "" ;else: foreach($list as $key=>$k): ?>
                                        <tr>
                                            <td><?php echo htmlentities($k['username']); ?></td>
                                            <td class="am-hide-sm-only"><?php echo date('Y-m-d H:i:s',$k['update_time']); ?></td>
                                            <td>
                                                <div class="am-btn-toolbar">
                                                    <div class="am-btn-group am-btn-group-xs">
                                                        <button type="button" class="am-btn am-btn-default am-btn-xs am-text-secondary" onclick="edit(<?php echo htmlentities($k['id']); ?>)"><span class="am-icon-pencil-square-o"></span> 编辑</button>
                                                        <button type="button" class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only" onclick="delone(<?php echo htmlentities($k['id']); ?>)"><span class="am-icon-trash-o"></span> 删除</button>
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                    <?php endforeach; endif; else: echo "" ;endif; ?>
                                    </tbody>
                                </table>
                                <div class="am-cf">
                                    <?php echo htmlentities($list->render()); ?>
                                </div>
                                <hr>
                            </form>
                        </div>

                    </div>
                </div>
                <div class="tpl-alert"></div>
            </div>
        </div>
    </div>
        <script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
        <script src="/xtbb/tp/public/admin/assets/js/jquery.min.js"></script>
        <script src="/xtbb/tp/public/admin/assets/js/amazeui.min.js"></script>
        <script src="/xtbb/tp/public/admin/assets/js/app.js"></script>
        <script type="text/javascript">
            function delone($k) {
               if (confirm('确定要删除这个用户吗？')){
                   $.ajax({
                       type:"get",
                       url:"<?php echo url('user/del'); ?>",
                       async:true,
                       data:{
                            'id': $k
                        },
                       dataType:"json",
                       success:function (xhr) {
                           // console.log(xhr);
                           if (xhr.code == 200) {
                               alert('删除成功');
                           }
                           else {
                               alert('删除失败请检查您所选择的目标');
                           }
                            window.location.href="<?php echo url('user/index'); ?>";

                       },
                       error:function () {
                           alert('删除失败')
                       }
                   });
               }
            }
            function add() {
                window.location.href="<?php echo url('user/show_add'); ?>";
            }
            function  edit($k) {
                window.location.href="<?php echo url('user/show_edit'); ?>?id="+$k;
            }
        </script>
</body>

</html>